package com.shenmazong.controller;


import com.shenmazong.entity.TbVideo;
import com.shenmazong.service.TbVideoService;
import com.shenmazong.utils.ResultResponse;
import com.shenmazong.vo.ListParamVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 教学视频 ——>  John 前端控制器
 * </p>
 *
 * @author 还怕大雨吗
 * @since 2021-09-18
 */
@RestController
@RequestMapping("/tbVideo")
@CrossOrigin
public class TbVideoController {

    @Resource
    private TbVideoService tbVideoService;


    /**
     * @description 查询视频
     * @params [listParamVo]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/21 19:40
     */
    @PostMapping("/selectVideo")
    public ResultResponse selectVideo(@RequestBody ListParamVo listParamVo){
        return tbVideoService.selectVideo(listParamVo);
    }

    /***
     * @description 新增视频
     * @params [tbVideo]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/21 19:41
     */
    @PostMapping("/insertVideo")
    public ResultResponse insertVideo(@RequestBody TbVideo tbVideo){
        return tbVideoService.insertVideo(tbVideo);
    }

    /***
     * @description 修改视频信息，
     * @params [tbVideo]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/21 19:44
     */
    @PostMapping("/updateVideo")
    public ResultResponse updateVideo(@RequestBody TbVideo tbVideo){
        return tbVideoService.updateVideo(tbVideo);
    }


    /***
     * @description 删除视频信息
     * @params [tbVidel]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/21 19:49
     */
    @PostMapping("/deleteVideo")
    public ResultResponse deleteVideo(Long tbVidel){
        return tbVideoService.deleteVideo(tbVidel);
    }


}

